/*
 * @LastEditors: zenghao
 * @Description: 路由配置
 * @Date: 2022-09-17 14:35:02
 * @LastEditTime: 2023-12-12 17:26:49
 * @Author: isboyjc
 */
import { createRouter, createWebHashHistory } from "vue-router";
import { menuRouter } from "./menuRouter";
// const viteEnv = loadEnv(mode, "./");
const router = createRouter({
  history: createWebHashHistory(),  // https://juejin.cn/post/7277483626775412755
  // history: createWebHashHistory(viteEnv.VITE_BASE),
  mode:'hash',
  routes: [
    {
      path: '/',
      name: 'SwitchLayout',
      component: () => import('@/layout/SwitchIndex.vue'),
      redirect: '/',
      children: [
        {
          path: '/',
          name: 'HomePage',
          meta: {
            title: 'ExeHubTools'
          },
          component: () => import('@/views/HomePage.vue')
        },
        {
          path: '/404',
          name: '404',
          meta: {
            title: '404'
          },
          component: () => import('@/views/404.vue')
      },
      {
          path: '/:pathMatch(.*)',
          redirect: '/404'
      },
        ...menuRouter
      ]
    }
  ]
})

export default router
